blob: a34fa848f72fdd415ae6b06b4fbbe871e89eb1fe [file] [log] [blame]
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -08001Gerrit Code Review - Configuration
2==================================
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004File `etc/gerrit.config`
5------------------------
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07006
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08007The optional file `'$site_path'/etc/gerrit.config` is a Git-style
8config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07009
10[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080011The contents of the `etc/gerrit.config` file are cached at startup
Brandon Casey4a21add2011-07-05 13:14:18 -050012by Gerrit. If you modify any properties in this file, Gerrit needs
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070013to be restarted before it will use the new values.
14
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080015Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070016----
17[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080018 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070019
20[cache]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080021 directory = /var/cache/gerrit2
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070022----
23
Dave Borowitz45baa892012-02-23 16:43:05 -080024[[accounts]]Section accounts
25~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
Matthias Sohnf3360662012-04-05 15:42:52 +020027[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -080028+
29Controls visibility of other users' dashboard pages and
30completion suggestions to web users.
31+
32If `ALL`, all users are visible to all other users, even
33anonymous users.
34+
35If `SAME_GROUP`, only users who are also members of a group the
36current user is a member of are visible.
37+
38If `VISIBLE_GROUP`, only users who are members of at least one group
39that is visible to the current user are visible.
40+
41If `NONE`, no users other than the current user are visible.
42+
43Default is `ALL`.
44
Edwin Kempin49cb3e12011-06-29 14:35:14 +020045[[addreviewer]]Section addreviewer
46~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
48[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
49+
50The maximum number of reviewers a user can add at once by adding a
51group as reviewer without being asked to confirm the operation.
52+
53If set to 0, the user will never be asked to confirm adding a group
54as reviewer.
55+
56Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020057+
58This setting only applies for adding reviewers in the Gerrit WebUI,
59but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +020060link:cmd-set-reviewers.html[set-reviewers] command.
Edwin Kempin49cb3e12011-06-29 14:35:14 +020061
62[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
63+
64The maximum number of reviewers a user can add at once by adding a
65group as reviewer.
66+
67If set to 0, there is no limit for the number of reviewers that can
68be added at once by adding a group as reviewer.
69+
70Default is 20.
71
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -070072[[auth]]Section auth
73~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070074
75See also link:config-sso.html[SSO configuration].
76
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -070077[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070078+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070079Type of user authentication employed by Gerrit. The supported
80values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070081+
82* `OpenID`
83+
84The default setting. Gerrit uses any valid OpenID
85provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070086http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070087+
James E. Blairca8bc3b2011-12-21 18:12:26 +000088* `OpenID_SSO`
89+
90Supports OpenID from a single provider. There is no registration
91link, and the "Sign In" link sends the user directly to the provider's
92SSO entry point.
93+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070094* `HTTP`
95+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070096Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +020097HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070098solutions. With this setting enabled the authentication must
99take place in the web server or servlet container, and not from
100within Gerrit.
101+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700102* `HTTP_LDAP`
103+
104Exactly like `HTTP` (above), but additionally Gerrit pre-populates
105a user's full name and email address based on information obtained
106from the user's account object in LDAP. The user's group membership
107is also pulled from LDAP, making any LDAP groups that a user is a
108member of available as groups in Gerrit.
109+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200110* `CLIENT_SSL_CERT_LDAP`
111+
112This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900113Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200114authentication to work a Gerrit administrator has to import the root
115certificate of the trust chain used to issue the client's certificate
116into the <review-site>/etc/keystore.
117After the authentication is done Gerrit will obtain basic user
118registration (name and email) from LDAP, and some group memberships.
119Therefore, the "_LDAP" suffix in the name of this authentication type.
120This authentication type can only be used under hosted daemon mode, and
121the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400122Optionally, certificate revocation list file can be used
123at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200124+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700125* `LDAP`
126+
127Gerrit prompts the user to enter a username and a password, which
128it then verifies by performing a simple bind against the configured
129<<ldap.server,ldap.server>>. In this configuration the web server
130is not involved in the user authentication process.
131+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800132The actual username used in the LDAP simple bind request is the
133account's full DN, which is discovered by first querying the
134directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200135<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
136<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800137
138* `LDAP_BIND`
139+
140Gerrit prompts the user to enter a username and a password, which
141it then verifies by performing a simple bind against the configured
142<<ldap.server,ldap.server>>. In this configuration the web server
143is not involved in the user authentication process.
144+
David Pursehouse42f42042013-08-01 14:02:25 +0900145Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900146request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200147The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800148account information.
149+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700150* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
151+
152*DO NOT USE*. Only for use in a development environment.
153+
154When this is the configured authentication method a hyperlink titled
155`Become` appears in the top right corner of the page, taking the
156user to a form where they can enter the username of any existing
157user account, and immediately login as that account, without any
158authentication taking place. This form of authentication is only
159useful for the GWT hosted mode shell, where OpenID authentication
160redirects might be risky to the developer's host computer, and HTTP
161authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700162
163+
164By default, OpenID.
165
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700166[[auth.allowedOpenID]]auth.allowedOpenID::
167+
168List of permitted OpenID providers. A user may only authenticate
169with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900170is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700171+
Magnus Bäcke5611832011-02-02 08:57:15 +0100172Patterns may be either a
173link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
174Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700175end with `$`) or be a simple prefix (any other string).
176+
177By default, the list contains two values, `http://` and `https://`,
178allowing users to authenticate with any OpenID provider.
179
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700180[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700181+
David Pursehouse221d4f62012-06-08 17:38:08 +0900182List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900183set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700184+
185In order for a user to take advantage of permissions beyond those
186granted to the `Anonymous Users` and `Registered Users` groups,
187the user account must only have OpenIDs which match at least one
188pattern from this list.
189+
Magnus Bäcke5611832011-02-02 08:57:15 +0100190Patterns may be either a
191link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
192Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700193end with `$`) or be a simple prefix (any other string).
194+
195By default, the list contains two values, `http://` and `https://`,
196allowing Gerrit to trust any OpenID it receives.
197
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100198[[auth.openIdDomain]]auth.openIdDomain::
199+
200List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900201`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100202+
203Domain is case insensitive and must be in the same form as it
204appears in the email address, for example, "example.com".
205+
206By default, any domain is accepted.
207
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700208[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
209+
210Time in seconds before an OpenID provider must force the user
211to authenticate themselves again before authentication to this
212Gerrit server. Currently this is only a polite request, and users
213coming from providers that don't support the PAPE extension will
214be accepted anyway. In the future it may be enforced, rejecting
215users coming from providers that don't honor the max session age.
216+
217If set to 0, the provider will always force the user to authenticate
218(e.g. supply their password). Values should use common unit suffixes
219to express their setting:
220+
221* s, sec, second, seconds
222* m, min, minute, minutes
223* h, hr, hour, hours
224* d, day, days
225* w, week, weeks (`1 week` is treated as `7 days`)
226* mon, month, months (`1 month` is treated as `30 days`)
227* y, year, years (`1 year` is treated as `365 days`)
228
229+
230Default is -1, permitting infinite time between authentications.
231
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700232[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
233+
234Time in seconds before an email verification token sent to a user in
235order to validate their email address expires.
236+
237* s, sec, second, seconds
238* m, min, minute, minutes
239* h, hr, hour, hours
240* d, day, days
241* w, week, weeks (`1 week` is treated as `7 days`)
242* mon, month, months (`1 month` is treated as `30 days`)
243* y, year, years (`1 year` is treated as `365 days`)
244
245+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800246Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700247
James E. Blairca8bc3b2011-12-21 18:12:26 +0000248[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
249+
David Pursehouse42f42042013-08-01 14:02:25 +0900250The SSO entry point URL. Only used if `auth.type` is set to
251`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000252+
253The "Sign In" link will send users directly to this URL.
254
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700255[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700256+
257HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900258or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700259
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100260[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
261+
262HTTP header to retrieve the user's display name from. Only used if `auth.type`
263is set to `HTTP`.
264+
265If set, Gerrit trusts and enforces the user's full name using the HTTP header
266and disables the ability to manually modify the user's full name
267from the contact information page.
268
269[[auth.httpEmailHeader]]auth.httpEmailHeader::
270+
271HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
272is set to `HTTP`.
273+
274If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
275and disables the ability to manually modify or register other e-mails
276from the contact information page.
277
Luca Milanesio5185b042013-07-27 22:03:06 +0100278[[auth.loginUrl]]auth.loginUrl::
279+
280URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900281login link in the upper right corner. Only used if `auth.type` is set
282to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100283Organizations using an enterprise single-sign-on solution may want to
284redirect the browser to the SSO product's sign-in page for completing the
285login process and validate their credentials.
286+
David Pursehouse42f42042013-08-01 14:02:25 +0900287If set, Gerrit allows anonymous access until the end-user performs the login
288and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100289If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900290and returns the error page 'LoginRedirect.html' if such a header is not
291present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100292
293[[auth.loginText]]auth.loginText::
294+
David Pursehouse42f42042013-08-01 14:02:25 +0900295Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100296+
David Pursehouse42f42042013-08-01 14:02:25 +0900297If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100298
Luca Milanesio111e0b72013-08-15 18:56:42 +0100299[[auth.registerPageUrl]]auth.registerPageUrl::
300+
David Pursehouse268744b2013-08-17 15:32:11 +0900301URL of the registration page to use when a new user logs in to Gerrit for
302the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100303+
304If not set, the standard Gerrit registration page `/#/register/` is displayed.
305
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700306[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700307+
308URL to redirect a browser to after the end-user has clicked on the
309"Sign Out" link in the upper right corner. Organizations using an
310enterprise single-sign-on solution may want to redirect the browser
311to the SSO product's sign-out page.
312+
313If not set, the redirect returns to the list of all open changes.
314
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800315[[auth.registerUrl]]auth.registerUrl::
316+
317Target for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900318when `auth.type` is `LDAP`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800319+
320If not set, no "Register" link is displayed.
321
Chad Horohoe65897082012-11-10 10:26:25 -0800322[[auth.registerText]]auth.registerText::
323+
324Text for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900325when `auth.type` is `LDAP`.
Chad Horohoe65897082012-11-10 10:26:25 -0800326+
327If not set, defaults to "Register".
328
David Pursehouse3d604492013-01-25 17:41:53 +0900329[[auth.editFullNameUrl]]auth.editFullNameUrl::
330+
331Target for the "Edit" button when the user is allowed to edit their
332full name.
333
334[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
335+
David Pursehouse42f42042013-08-01 14:02:25 +0900336Target for the "Obtain Password" link. Used only when `auth.type` is
David Pursehouse3d604492013-01-25 17:41:53 +0900337`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700338
339[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900340+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700341URL to switch user identities and login as a different account than
342the currently active account. This is disabled by default except when
343`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
344the "Switch Account" link is displayed next to "Sign Out".
345+
346When `auth.type` does not normally enable this URL administrators may
347set this to `login/` or `$canonicalWebUrl/login`, allowing users to
348begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900349
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000350[[auth.cookiePath]]auth.cookiePath::
351+
352Sets "path" attribute of the authentication cookie.
353+
354If not set, HTTP request's path is used.
355
356[[auth.cookieSecure]]auth.cookieSecure::
357+
358Sets "secure" flag of the authentication cookie. If true, cookies
359will be transmitted only over HTTPS protocol.
360+
361By default, false.
362
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700363[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700364+
365Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900366user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700367or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700368+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700369This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700370with the login name. E.g. "\{0\}+gerrit@example.com" with a user
371login name of "foo" will produce "foo+gerrit@example.com" during
372the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700373+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700374If the site is using `HTTP_LDAP` or `LDAP`, using this option is
375discouraged. Setting `ldap.accountEmailAddress` and importing the
376email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700377
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700378[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700379+
380Controls whether or not the contributor agreement features are
381enabled for the Gerrit site. If enabled a user must complete a
382contributor agreement before they can upload changes.
383+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800384If enabled, the admin must also add one or more
385link:config-cla.html[contributor-agreement sections]
386in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700387`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700388more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700389+
390By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700391+
392To enable the actual usage of contributor agreement the project
393specific config option in the `project.config` must be set:
394link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700395
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700396auth.allowGoogleAccountUpgrade::
397+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700398Allows Google Account users to automatically update their Gerrit
399account when/if their Google Account OpenID identity token changes.
400Identity tokens can change if the server changes hostnames, or
401for other reasons known only to Google. The upgrade path works
402by matching users by email address if the identity is not present,
403and then changing the identity.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700404+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700405This setting also permits old Gerrit 1.x users to seamlessly upgrade
406from Google Accounts on Google App Engine to OpenID authentication.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700407+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700408Having this enabled incurs an extra database query when Google
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -0800409Account users register with the Gerrit server.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700410+
411By default, unset/false.
412
Christian Halstricka3d88a52011-08-31 09:21:41 +0200413[[auth.trustContainerAuth]]auth.trustContainerAuth::
414+
415If true then it is the responsibility of the container hosting
416Gerrit to authenticate users. In this case Gerrit will blindly trust
417the container.
418+
419This parameter only affects git over http traffic. If set to false
420then Gerrit will do the authentication (using DIGEST authentication).
421+
422By default this is set to false.
423
Luca Milanesio42058842012-01-05 21:25:38 +0000424[[auth.gitBasicAuth]]auth.gitBasicAuth::
425+
426If true then Git over HTTP and HTTP/S traffic is authenticated using
427standard BasicAuth and credentials validated using the same auth
428method configured for Gerrit Web UI.
429+
430This parameter only affects git over http traffic. If set to false
431then Gerrit will authenticate through DIGEST authentication and
432the randomly generated HTTP password in Gerrit DB.
433+
434By default this is set to false.
435
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200436[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
437+
438If set the username that is received to authenticate a git operation
439is converted to lower case for looking up the user account in Gerrit.
440+
441By setting this parameter a case insensitive authentication for the
442git operations can be achieved, if it is ensured that the usernames in
443Gerrit (scheme `username`) are stored in lower case (e.g. if the
444parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
445set to `${sAMAccountName.toLowerCase}`). It is important that for all
446existing accounts this username is already in lower case. It is not
447possible to convert the usernames of the existing accounts to lower
448case because this would break the access to existing per-user
449branches.
450+
451This parameter only affects git over http and git over SSH traffic.
452+
453By default this is set to false.
454
Shawn Pearcea931fe12013-06-11 12:29:17 -0700455[[auth.enableRunAs]]auth.enableRunAs::
456+
457If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
458header from any users granted the link:access-control.html#capability_runAs[Run As]
459capability. The header and capability permit the authenticated user
460to impersonate another account.
461+
462If false the feature is disabled and cannot be re-enabled without
463editing gerrit.config and restarting the server.
464+
465Default is true.
466
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700467[[cache]]Section cache
468~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700469
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700470[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700471+
472Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700473future lookup. This local disk cache is used to retain potentially
474expensive to compute information across restarts. If the location
475does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700476+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700477If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700478+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700479Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700480
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700481[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700482+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700483Maximum age to keep an entry in the cache. Entries are removed from
484the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700485Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700486+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700487* s, sec, second, seconds
488* m, min, minute, minutes
489* h, hr, hour, hours
490* d, day, days
491* w, week, weeks (`1 week` is treated as `7 days`)
492* mon, month, months (`1 month` is treated as `30 days`)
493* y, year, years (`1 year` is treated as `365 days`)
494
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700495+
Edwin Kempinabcd5042013-03-12 16:04:37 +0100496If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700497supplied, the maximum age is infinite and items are never purged
498except when the cache is full.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700499+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700500Default is `0`, meaning store forever with no expire, except:
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700501+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400502* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700503* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700504* `"web_sessions"`: default is `12 hours`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700505
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700506[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700507+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700508The total cost of entries to retain in memory. The cost computation
509varies by the cache. For most caches where the in-memory size of each
510entry is relatively the same, memoryLimit is currently defined to be
511the number of entries held by the cache (each entry costs 1).
512+
513For caches where the size of an entry can vary significantly between
514individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
515is an approximation of the total number of bytes stored by the cache.
516Larger entries that represent bigger patch sets or longer source files
517will consume a bigger portion of the memoryLimit. For these caches the
518memoryLimit should be set to roughly the amount of RAM (in bytes) the
519administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700520+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700521Default is 1024 for most caches, except:
522+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400523* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700524* `"diff"`: default is `10m` (10 MiB of memory)
525* `"diff_intraline"`: default is `10m` (10 MiB of memory)
526* `"plugin_resources"`: default is 2m (2 MiB of memory)
527
528+
529If set to 0 the cache is disabled. Entries are removed immediately
530after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700531
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700532[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700533+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700534Total size in bytes of the keys and values stored on disk. Caches that
535have grown bigger than this size are scanned daily at 1 AM local
536server time to trim the cache. Entries are removed in least recently
537accessed order until the cache fits within this limit. Caches may
538grow larger than this during the day, as the size check is only
539performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700540+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700541Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700542+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700543If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700544
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700545[[cache_names]]Standard Caches
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700546^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700547
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700548cache `"accounts"`::
549+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700550Cache entries contain important details of an active user, including
551their display name, preferences, known email addresses, and group
552memberships. Entry information is obtained from the following
553database tables:
554+
555* `accounts`
556+
557* `account_group_members`
558+
559* `account_external_ids`
560
561+
562If direct updates are made to any of these database tables, this
563cache should be flushed.
564
565cache `"accounts_byemail"`::
566+
567Caches account identities keyed by email address, which is scanned
568from the `account_external_ids` database table. If updates are
569made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700570
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400571cache `"adv_bases"`::
572+
573Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900574are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400575for the client to use as potential delta bases. Push over smart HTTP
576requires two HTTP requests, and this cache tries to carry state from
577the first request into the second to ensure it can complete.
578
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200579cache `"changes"`::
580+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200581The size of `memoryLimit` determines the number of projects for which
582all changes will be cached. If the cache is set to 1024, this means all
583changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800584+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200585Default value is 0 (disabled). It is disabled by default due to the fact
586that change updates are not communicated between Gerrit servers. Hence
587this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800588+
589The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700590outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200591
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700592cache `"diff"`::
593+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700594Each item caches the differences between two commits, at both the
595directory and file levels. Gerrit uses this cache to accelerate
596the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700597+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700598Entries in this cache are relatively large, so memoryLimit is an
599estimate in bytes of memory used. Administrators should try to target
600cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
601day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700602
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400603cache `"diff_intraline"`::
604+
605Each item caches the intraline difference of one file, when compared
606between two commits. Gerrit uses this cache to accelerate display of
607intraline differences when viewing a file.
608+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700609Entries in this cache are relatively large, so memoryLimit is an
610estimate in bytes of memory used. Administrators should try to target
611cache.diff.memoryLimit to fit all files users will view in a 1 or 2
612day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400613
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700614cache `"git_tags"`::
615+
616If branch or reference level READ access controls are used, this
617cache tracks which tags are reachable from the branch tips of a
618repository. Gerrit uses this information to determine the set
619of tags that a client may access, derived from which tags are
620part of the history of a visible branch.
621+
622The cache is persisted to disk across server restarts as it can
623be expensive to compute (60 or more seconds for a large history
624like the Linux kernel repository).
625
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700626cache `"groups"`::
627+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700628Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700629including the group owner, name, and description.
630+
631Gerrit group membership obtained from the `account_group_members`
632table is cached under the `"accounts"` cache, above. External group
633membership obtained from LDAP is cached under `"ldap_groups"`.
634
Matt Fischer620255a2011-03-22 14:28:23 -0500635cache `"groups_byinclude"`::
636+
637Caches group inclusions in other groups. If direct updates are made
638to the `account_group_includes` table, this cache should be flushed.
639
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700640cache `"ldap_groups"`::
641+
642Caches the LDAP groups that a user belongs to, if LDAP has been
643configured on this server. This cache should be configured with a
644low maxAge setting, to ensure LDAP modifications are picked up in
645a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700646
Gustaf Lundh0919a492012-10-19 15:29:23 +0200647cache `"ldap_groups_byinclude"`::
648+
649Caches the hierarchical structure of LDAP groups.
650
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700651cache `"ldap_usernames"`::
652+
653Caches a mapping of LDAP username to Gerrit account identity. The
654cache automatically updates when a user first creates their account
655within Gerrit, so the cache expire time is largely irrelevant.
656
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700657cache `"permission_sort"`::
658+
David Pursehouse221d4f62012-06-08 17:38:08 +0900659Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700660reference. Sorting the sections can be expensive when regular
661expressions are used, so this cache remembers the ordering for
662each branch.
663
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700664cache `"plugin_resources"`::
665+
666Caches formatted plugin resources, such as plugin documentation that
667has been converted from Markdown to HTML. The memoryLimit refers to
668the bytes of memory dedicated to storing the documentation.
669
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700670cache `"projects"`::
671+
672Caches the project description records, from the `projects` table
673in the database. If a project record is updated or deleted, this
674cache should be flushed. Newly inserted projects do not require
675a cache flush, as they will be read upon first reference.
676
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700677cache `"sshkeys"`::
678+
679Caches unpacked versions of user SSH keys, so the internal SSH daemon
680can match against them during authentication. The unit of storage
681is per-user, so 1024 items translates to 1024 unique user accounts.
682As each individual user account may configure multiple SSH keys,
683the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700684+
685This cache is based off the `account_ssh_keys` table and the
686`accounts.ssh_user_name` column in the database. If either is
687modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700688
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700689cache `"web_sessions"`::
690+
691Tracks the live user sessions coming in over HTTP. Flushing this
692cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700693them to sign-in again. To avoid breaking active users, this cache
694is not flushed automatically by `gerrit flush-caches --all`, but
695instead must be explicitly requested.
696+
697If no disk cache is configured (or `cache.web_sessions.diskLimit`
698is set to 0) a server restart will force all users to sign-out,
699and need to sign-in again after the restart, as the cache was
700unable to persist the session information. Enabling a disk cache
701is strongly recommended.
702+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700703Session storage is relatively inexpensive. The average entry in
704this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700705
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700706See also link:cmd-flush-caches.html[gerrit flush-caches].
707
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800708[[cache_options]]Cache Options
709^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
710
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800711cache.diff_intraline.maxIdleWorkers::
712+
713Number of idle worker threads to maintain for the intraline difference
714computations. There is no upper bound on how many concurrent requests
715can occur at once, if additional threads are started to handle a peak
David Pursehouse221d4f62012-06-08 17:38:08 +0900716load, only this many will remain idle afterwards.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800717+
718Default is 1.5x number of available CPUs.
719
720cache.diff_intraline.timeout::
721+
722Maximum number of milliseconds to wait for intraline difference data
723before giving up and disabling it for a particular file pair. This is
724a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900725implementation.
726+
727If computation takes longer than the timeout, the worker thread is
728terminated, an error message is shown, and no intraline difference is
729displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800730+
731Values should use common unit suffixes to express their setting:
732+
733* ms, milliseconds
734* s, sec, second, seconds
735* m, min, minute, minutes
736* h, hr, hour, hours
737
738+
739If a unit suffix is not specified, `milliseconds` is assumed.
740+
741Default is 5 seconds.
742
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800743cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800744+
745Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800746when populating a diff cache entry. This flag is provided primarily
747as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900748necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800749this setting will fallback to `cache.diff.intraline` if not set in the
750configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800751+
752Default is true, enabled.
753
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700754cache.projects.checkFrequency::
755+
756How often project configuration should be checked for update from Git.
757Gerrit Code Review caches project access rules and configuration in
758memory, checking the refs/meta/config branch every checkFrequency
759minutes to see if a new revision should be loaded and used for future
760access. Values can be specified using standard time unit abbreviations
761('ms', 'sec', 'min', etc.).
762+
763If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800764If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700765Administrators may force the cache to flush with
766link:cmd-flush-caches.html[gerrit flush-caches].
767+
768Default is 5 minutes.
769
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700770[[change]]Section change
771~~~~~~~~~~~~~~~~~~~~~~~~
772
773[[change.updateDelay]]change.updateDelay::
774+
775How often in seconds the web interface should poll for updates to the
776currently open change. The poller relies on the client's browser
777cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700778responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700779+
780With a configured 30 second delay a server with 4900 active users will
781typically need to dedicate 1 CPU to the update check. 4900 users
782divided by an average delay of 30 seconds is 163 requests arriving per
783second. If requests are served at ~6 ms response time, 1 CPU is
784necessary to keep up with the update request traffic. On a smaller
785user base of 500 active users, the default 30 second delay is only 17
786requests per second and requires ~10% CPU.
787+
788If 0 the update polling is disabled.
789+
790Default is 30 seconds.
791
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300792[[changeMerge]]Section changeMerge
Remy Bohmer203eea32012-02-19 21:21:36 +0100793~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300794
Dave Borowitz204669c22012-10-11 11:06:08 -0700795changeMerge.checkFrequency::
796+
797How often the database should be rescanned for changes that have been
798submitted but not merged due to transient errors. Values can be
799specified using standard time unit abbreviations ('ms', 'sec', 'min',
800etc.). Set to 0 to disable periodic rescanning, only scanning once on
801master node startup.
802+
803Default is 300 seconds (5 minutes).
804
805changeMerge.test::
806+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300807Controls whether or not the mergeability test of changes is
808enabled. If enabled, when the change page is loaded, the test is
809triggered. The submit button will be enabled or disabled according to
810the result.
Dave Borowitz204669c22012-10-11 11:06:08 -0700811+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300812By default this is false (test is not enabled).
813
Brad Larson991a31b2009-11-03 14:30:26 -0600814[[commentlink]]Section commentlink
Remy Bohmer203eea32012-02-19 21:21:36 +0100815~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brad Larson991a31b2009-11-03 14:30:26 -0600816Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -0500817patch comments, in-line code comments and approval category value descriptions
818to turn set strings into hyperlinks. One common use is for linking to
819bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -0600820
821In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800822will match typical Gerrit Change-Id values and create a hyperlink
823to changes which reference it. The second configuration 'bugzilla'
824will hyperlink terms such as 'bug 42' to an external bug tracker,
825supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +0900826configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800827how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -0600828
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800829----
830[commentlink "changeid"]
831 match = (I[0-9a-f]{8,40})
832 link = "#q,$1,n,z"
Brad Larson991a31b2009-11-03 14:30:26 -0600833
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800834[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800835 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800836 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -0600837
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800838[commentlink "tracker"]
839 match = ([Bb]ug:\\s+)(\\d+)
840 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
841----
842
Dave Borowitz13b38002013-04-08 12:03:29 -0700843Comment links can also be specified in `project.config` and sections in
844children override those in parents. The only restriction is that to
845avoid injecting arbitrary user-supplied HTML in the page, comment links
846defined in `project.config` may only supply `link`, not `html`.
847
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800848[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -0600849+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800850A JavaScript regular expression to match positions to be replaced
851with a hyperlink. Subexpressions of the matched string can be
852stored using groups and accessed with `$'n'` syntax, where 'n'
853is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -0600854+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800855The configuration file parser eats one level of backslashes, so the
856character class `\s` requires `\\s` in the configuration file. The
857parser also terminates the line at the first `#`, so a match
858expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800859+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -0800860To match case insensitive strings, a character class with both the
861upper and lower case character for each position must be used. For
862example, to match the string `bug` in a case insensitive way the match
863pattern `[bB][uU][gG]` needs to be used.
864+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800865A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -0600866
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800867[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -0600868+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800869The URL to direct the user to whenever the regular expression is
870matched. Groups in the match expression may be accessed as `$'n'`.
871+
872The link property is used only when the html property is not present.
873
874[[commentlink.name.html]]commentlink.<name>.html::
875+
876HTML to replace the entire matched string with. If present,
877this property overrides the link property above. Groups in the
878match expression may be accessed as `$'n'`.
879+
880The configuration file eats double quotes, so escaping them as
881`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -0600882
Dave Borowitz82d79c02013-04-08 15:45:12 -0700883[[commentlink.name.enabled]]commentlink.<name>.enabled::
884+
885Whether the comment link is enabled. A child project may override a
886section in a parent or the site-wide config that is disabled by
887specifying `enabled = true`.
888+
889Disabling sections in `gerrit.config` can be used by site administrators
890to create a library of comment links with `html` set that are not
891user-supplied and thus can be verified to be XSS-free, but are only
892enabled for a subset of projects.
893+
894Note that the names and contents of disabled sections are visible even
895to anonymous users via the
896link:rest-api-projects.html#get-config[REST API].
897
Brad Larson991a31b2009-11-03 14:30:26 -0600898
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700899[[contactstore]]Section contactstore
900~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700901
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700902[[contactstore.url]]contactstore.url::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700903+
904URL of the web based contact store Gerrit will send any offline
905contact information to when it collects the data from users as part
906of a contributor agreement.
907+
908See link:config-contact.html[Contact Information].
909
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700910[[contactstore.appsec]]contactstore.appsec::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700911+
912Shared secret of the web based contact store.
913
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800914
915[[container]]Section container
916~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
917
918These settings are applied only if Gerrit is started as the container
919process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
920
921[[container.heapLimit]]container.heapLimit::
922+
923Maximum heap size of the Java process running Gerrit, in bytes.
924This property is translated into the '-Xmx' flag for the JVM.
925+
926Default is platform and JVM specific.
927+
928Common unit suffixes of 'k', 'm', or 'g' are supported.
929
930[[container.javaHome]]container.javaHome::
931+
932Path of the JRE/JDK installation to run Gerrit with. If not set, the
933Gerrit startup script will attempt to search your system and guess
934a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
935
936[[container.javaOptions]]container.javaOptions::
937+
938Additional options to pass along to the Java runtime. If multiple
939values are configured, they are passed in order on the command line,
940separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
941
David Ostrovskyc772bd82013-10-03 10:37:51 +0200942For example, it is possible to overwrite Gerrit's default log4j
943configuration:
944
945----
946 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
947----
948
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200949[[container.slave]]container.slave::
950+
951Used on Gerrit slave installations. If set to true the Gerrit JVM is
952called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -0700953set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200954
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800955[[container.user]]container.user::
956+
957Login name (or UID) of the operating system user the Gerrit JVM
958will execute as. If not set, defaults to the user who launched
959the 'gerrit.sh' wrapper script.
960
961[[container.war]]container.war::
962+
963Path of the JAR file to start daemon execution with. This should
964be the path of the local 'gerrit.war' archive. Overrides the
965environment variable 'GERRIT_WAR'.
966+
967If not set, defaults to '$site_path/bin/gerrit.war', or to
968'$HOME/gerrit.war'.
969
970
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700971[[core]]Section core
972~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700973
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700974[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700975+
976Number of bytes of a pack file to load into memory in a single
977read operation. This is the "page size" of the JGit buffer cache,
978used for all pack access operations. All disk IO occurs as single
979window reads. Setting this too large may cause the process to load
980more data than is required; setting this too small may increase
981the frequency of `read()` system calls.
982+
983Default on JGit is 8 KiB on all platforms.
984+
985Common unit suffixes of 'k', 'm', or 'g' are supported.
986
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700987[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700988+
989Maximum number of bytes to load and cache in memory from pack files.
990If JGit needs to access more than this many bytes it will unload less
991frequently used windows to reclaim memory space within the process.
992As this buffer must be shared with the rest of the JVM heap, it
993should be a fraction of the total memory available.
994+
995Default on JGit is 10 MiB on all platforms.
996+
997Common unit suffixes of 'k', 'm', or 'g' are supported.
998
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700999[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001000+
1001Maximum number of bytes to reserve for caching base objects
1002that multiple deltafied objects reference. By storing the entire
1003decompressed base object in a cache Git is able to avoid unpacking
1004and decompressing frequently used base objects multiple times.
1005+
1006Default on JGit is 10 MiB on all platforms. You probably do not
1007need to adjust this value.
1008+
1009Common unit suffixes of 'k', 'm', or 'g' are supported.
1010
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001011[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001012+
1013Maximum number of pack files to have open at once. A pack file
1014must be opened in order for any of its data to be available in
1015a cached window.
1016+
1017If you increase this to a larger setting you may need to also adjust
1018the ulimit on file descriptors for the host JVM, as Gerrit needs
1019additional file descriptors available for network sockets and other
1020repository data manipulation.
1021+
1022Default on JGit is 128 file descriptors on all platforms.
1023
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001024[[core.streamFileThreshold]]core.streamFileThreshold::
1025+
1026Largest object size, in bytes, that JGit will allocate as a
1027contiguous byte array. Any file revision larger than this threshold
1028will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001029files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001030during delta decompression.
1031+
1032Servers with very high traffic should set this to be larger than
1033the size of their common big files. For example a server managing
1034the Android platform typically has to deal with ~10-12 MiB XML
1035files, so `15 m` would be a reasonable setting in that environment.
1036Setting this too high may cause the JVM to run out of heap space
1037when handling very big binary files, such as device firmware or
1038CD-ROM ISO images.
1039+
Shawn O. Pearcee3febd92010-10-13 21:17:53 -07001040Default is 50 MiB on all platforms. Prior to Gerrit 2.1.6,
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001041this value was effectively 2047 MiB.
1042+
1043Common unit suffixes of 'k', 'm', or 'g' are supported.
1044
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001045[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001046+
1047When true, JGit will use `mmap()` rather than `malloc()+read()`
1048to load data from pack files. The use of mmap can be problematic
1049on some JVMs as the garbage collector must deduce that a memory
1050mapped segment is no longer in use before a call to `munmap()`
1051can be made by the JVM native code.
1052+
1053In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001054pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001055of virtual address space, as the garbage collector cannot reclaim
1056unused mapped spaces fast enough.
1057+
1058Default on JGit is false. Although potentially slower, it yields
1059much more predictable behavior.
1060
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001061[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1062+
1063Size of the buffer to store logging events for asynchronous logging.
1064Putting a larger value can protect threads from stalling when the
1065AsyncAppender threads are not fast enough to consume the logging events
1066from the buffer. It also protects from loosing log entries in this case.
1067+
1068Default is 64 entries.
1069
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001070[[core.useRecursiveMerge]]core.useRecursiveMerge::
1071+
1072Use JGit's new, experimental recursive merger for three-way merges.
1073This only affects projects configured to automatically resolve
1074conflicts.
1075+
1076Default is false, but in a future release may default to true.
1077
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001078[[database]]Section database
1079~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1080
1081The database section configures where Gerrit stores its metadata
1082records about user accounts and change reviews.
1083
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001084----
1085[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001086 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001087 hostname = localhost
1088 database = reviewdb
1089 username = gerrit2
1090 password = s3kr3t
1091----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001092
1093[[database.type]]database.type::
1094+
1095Type of database server to connect to. If set this value will be
1096used to automatically create correct database.driver and database.url
1097values to open the connection.
1098+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001099* `POSTGRESQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001100+
1101Connect to a PostgreSQL database server.
1102+
1103* `H2`
1104+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001105Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001106+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001107* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001108+
1109Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001110+
1111* `JDBC`
1112+
1113Connect using a JDBC driver class name and URL.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001114
1115+
1116If not specified, database.driver and database.url are used as-is,
1117and if they are also not specified, defaults to H2.
1118
1119[[database.hostname]]database.hostname::
1120+
1121Hostname of the database server. Defaults to 'localhost'.
1122
1123[[database.port]]database.port::
1124+
1125Port number of the database server. Defaults to the default port
1126of the server named by database.type.
1127
1128[[database.database]]database.database::
1129+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001130For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001131+
1132For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001133relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001134
1135[[database.username]]database.username::
1136+
1137Username to connect to the database server as.
1138
1139[[database.password]]database.password::
1140+
1141Password to authenticate to the database server with.
1142
1143[[database.driver]]database.driver::
1144+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001145Name of the JDBC driver class to connect to the database with.
1146Setting this usually isn't necessary as it can be derived from
1147database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001148
1149[[database.url]]database.url::
1150+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001151'jdbc:' URL for the database. Setting this variable usually
1152isn't necessary as it can be constructed from the all of the
1153above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001154
Christian Aistleitner851072a2013-05-05 15:04:09 +02001155[[database.connectionPool]]database.connectionPool::
1156+
1157If true, use connection pooling for database connections. Otherwise, a
1158new database connection is opened for each request.
1159+
1160Default is false for MySQL, and true for other database backends.
1161
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001162[[database.poolLimit]]database.poolLimit::
1163+
1164Maximum number of open database connections. If the server needs
1165more than this number, request processing threads will wait up
1166to <<database.poolMaxWait, poolMaxWait>> seconds for a
1167connection to be released before they abort with an exception.
1168This limit must be several units higher than the total number of
1169httpd and sshd threads as some request processing code paths may
1170need multiple connections.
1171+
1172Default is 8.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001173+
1174This setting only applies if
1175<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001176
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001177[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001178+
1179Minimum number of connections to keep idle in the pool.
1180Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001181+
1182This setting only applies if
1183<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001184
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001185[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001186+
1187Maximum number of connections to keep idle in the pool. If there
1188are more idle connections, connections will be closed instead of
1189being returned back to the pool.
1190Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001191+
1192This setting only applies if
1193<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001194
1195[[database.poolMaxWait]]database.poolMaxWait::
1196+
1197Maximum amount of time a request processing thread will wait to
1198acquire a database connection from the pool. If no connection is
1199released within this time period, the processing thread will abort
1200its current operations and return an error to the client.
1201Values should use common unit suffixes to express their setting:
1202+
1203* ms, milliseconds
1204* s, sec, second, seconds
1205* m, min, minute, minutes
1206* h, hr, hour, hours
1207
1208+
1209If a unit suffix is not specified, `milliseconds` is assumed.
1210+
1211Default is `30 seconds`.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001212+
1213This setting only applies if
1214<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001215
monica.dionisio3f630442010-06-29 15:42:57 -03001216[[download]]Section download
Nasser Grainawib9a50372010-08-10 07:57:47 -06001217~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monica.dionisio3f630442010-06-29 15:42:57 -03001218
1219----
1220[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001221 command = checkout
1222 command = cherry_pick
1223 command = pull
1224 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001225 scheme = ssh
1226 scheme = http
1227 scheme = anon_http
1228 scheme = anon_git
1229 scheme = repo_download
1230----
1231
1232The download section configures the allowed download methods.
1233
Edwin Kempin08b03a22012-09-14 16:32:57 +02001234[[download.command]]download.command::
1235+
1236Commands that should be offered to download changes.
1237+
1238Multiple commands are supported:
1239+
1240* `checkout`
1241+
1242Command to fetch and checkout the patch set.
1243+
1244* `cherry_pick`
1245+
1246Command to fetch the patch set and to cherry-pick it onto the current
1247commit.
1248+
1249* `pull`
1250+
1251Command to pull the patch set.
1252+
1253* `format_patch`
1254+
1255Command to fetch the patch set and to feed it into the `format-patch`
1256command.
1257
1258+
1259If `download.command` is not specified, all download commands are
1260offered.
1261
monica.dionisio3f630442010-06-29 15:42:57 -03001262[[download.scheme]]download.scheme::
1263+
1264Schemes that should be used to download changes.
1265+
1266Multiple schemes are supported:
1267+
1268* `http`
1269+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001270Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001271+
1272* `ssh`
1273+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001274Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001275+
1276* `anon_http`
1277+
1278Anonymous HTTP download is allowed.
1279+
1280* `anon_git`
1281+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001282Anonymous Git download is allowed. This is not default, it is also
1283necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1284variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001285+
1286* `repo_download`
1287+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001288Gerrit advertises patch set downloads with the `repo download`
1289command, assuming that all projects managed by this instance are
1290generally worked on with the repo multi-repository tool. This is
1291not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001292
1293+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001294If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001295downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001296
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001297[[gerrit]]Section gerrit
1298~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001299
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001300[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001301+
1302Local filesystem directory holding all Git repositories that
1303Gerrit knows about and can process changes for. A project
1304entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001305the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001306+
1307If relative, the path is resolved relative to `'$site_path'`.
1308
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001309[[gerrit.allProjects]]gerrit.allProjects::
1310+
1311Name of the permissions-only project defining global server
1312access controls and settings. These are inherited into every
1313other project managed by the running server. The name is
1314relative to `gerrit.basePath`.
1315+
1316Defaults to `All-Projects` if not set.
1317
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001318[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001319+
1320The default URL for Gerrit to be accessed through.
1321+
1322Typically this would be set to "http://review.example.com/" or
1323"http://example.com/gerrit/" so Gerrit can output links that point
1324back to itself.
1325+
1326Setting this is highly recommended, as its necessary for the upload
1327code invoked by "git push" or "repo upload" to output hyperlinks
1328to the newly uploaded changes.
1329
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001330[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001331+
1332Optional base URL for repositories available over the anonymous git
1333protocol. For example, set this to `git://mirror.example.com/base/`
1334to have Gerrit display patch set download URLs in the UI. Gerrit
1335automatically appends the project name onto the end of the URL.
1336+
1337By default unset, as the git daemon must be configured externally
1338by the system administrator, and might not even be running on the
1339same host as Gerrit.
1340
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001341[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1342+
1343Optional command to install the `commit-msg` hook. Typically of the
1344form:
1345----
1346fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1347----
Shawn Pearce6d731f52013-09-24 12:13:50 -07001348
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001349+
1350By default unset; falls back to using scp from the canonical SSH host,
1351or curl from the canonical HTTP URL for the server. Only necessary if a
1352proxy or other server/network configuration prevents clients from
1353fetching from the default location.
1354
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001355[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1356+
1357Optional base URL for repositories available over the HTTP
1358protocol. For example, set this to `http://mirror.example.com/base/`
1359to have Gerrit display URLs from this server, rather than itself.
1360+
1361By default unset, as the HTTP daemon must be configured externally
1362by the system administrator, and might not even be running on the
1363same host as Gerrit.
1364
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001365[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1366+
1367URL to direct users to when they need to report a bug about the
1368Gerrit service. By default this links to the upstream Gerrit
1369Code Review's own bug tracker but could be directed to the system
1370administrator's ticket queue.
1371
Shawn Pearce6d731f52013-09-24 12:13:50 -07001372[[gerrit.changeScreen]]gerrit.changeScreen::
1373+
1374Default change screen UI to direct users to. Valid values are
1375`OLD_UI` and `CHANGE_SCREEN2`. Default is `OLD_UI`.
1376
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001377[[gitweb]]Section gitweb
1378~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001379
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001380Gerrit can forward requests to either an internally managed gitweb
1381(which allows Gerrit to enforce some access controls), or to an
1382externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001383See also link:config-gitweb.html[Gitweb Integration].
1384
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001385[[gitweb.cgi]]gitweb.cgi::
1386+
1387Path to the locally installed `gitweb.cgi` executable. This CGI will
1388be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1389Project level access controls are enforced prior to calling the CGI.
1390+
1391Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1392
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001393[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001394+
1395Optional URL of an affiliated gitweb service. Defines the
1396web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001397gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001398+
1399Gerrit appends any necessary query arguments onto the end of this URL.
1400For example, "?p=$project.git;h=$commit".
1401
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001402[[gitweb.type]]gitweb.type::
1403+
1404Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001405alternatives to gitweb, such as cgit. If set to disabled there
1406is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001407+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001408Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001409
Edwin Kempind86909c2012-03-26 10:36:29 +02001410[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001411+
1412Optional pattern to use for constructing the gitweb URL when pointing
1413at a specific commit when `custom` is used above.
1414+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001415Valid replacements are `${project}` for the project name in Gerrit
1416and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001417
Edwin Kempind86909c2012-03-26 10:36:29 +02001418[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001419+
1420Optional pattern to use for constructing the gitweb URL when pointing
1421at a specific project when `custom` is used above.
1422+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001423Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001424
Edwin Kempind86909c2012-03-26 10:36:29 +02001425[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001426+
1427Optional pattern to use for constructing the gitweb URL when pointing
1428at a specific branch when `custom` is used above.
1429+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001430Valid replacements are `${project}` for the project name in Gerrit
1431and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001432
Edwin Kempin64011562012-03-26 10:50:12 +02001433[[gitweb.filehistory]]gitweb.filehistory::
1434+
1435Optional pattern to use for constructing the gitweb URL when pointing
1436at the history of a file in a specific branch when `custom` is used
1437above.
1438+
1439Valid replacements are `${project}` for the project name in Gerrit,
1440`${file}` for the file name and `${branch}` for the name of the
1441branch.
1442
Gustaf Lundha07d2e72011-10-27 15:26:35 -07001443[[gitweb.linkname]]gitweb.linkname::
1444+
1445Optional setting for modifying the link name presented to the user
1446in the Gerrit web-UI.
1447+
1448Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001449
Adrian Goerlerf2007072011-11-10 08:39:55 +01001450[[gitweb.pathSeparator]]gitweb.pathSeparator::
1451+
1452Optional character to substitute the standard path separator (slash) in
1453project names and branch names.
1454+
1455By default, Gerrit will use hexadecimal encoding for slashes in project and
1456branch names. Some web servers, such as Tomcat, reject this hexadecimal
1457encoding in the URL.
1458+
1459Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
1460allow using an alternative path separator character. In Gitblit, this can be
1461configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
1462In Gerrit, the alternative path separator can be configured correspondingly
1463using the property 'gitweb.pathSeparator'.
1464+
1465Valid values are the characters '*', '(' and ')'.
1466
Luca Milanesio25312032013-10-11 11:34:39 +01001467[[gitweb.linkDrafts]]gitweb.urlEncode::
1468+
1469Whether or not Gerrit should encode the generated viewer URL.
1470+
1471Gerrit composes the viewer URL using information about the project, branch, file
1472or commit of the target object to be displayed. Typically viewers such as CGit
1473and GitWeb do need those parts to be encoded, including the '/' in project's name,
1474for being correctly parsed.
1475However other viewers could instead require an unencoded URL (e.g. GitHub web
1476based viewer)
1477+
1478Valid values are "true" and "false," default is "true."
1479
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001480[[gitweb.linkDrafts]]gitweb.linkDrafts::
1481+
1482Whether or not Gerrit should provide links to gitweb on draft patch sets.
1483+
1484By default, Gerrit will show links to gitweb on all patch sets. If gitweb
1485only allows publicly viewable references, set this to false to remove
1486the links to draft patch sets from the change review screen.
1487+
Luca Milanesio25312032013-10-11 11:34:39 +01001488Valid values are "true" and "false," default is "true".
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001489
Edwin Kempin4bbff702013-01-11 09:59:53 +01001490[[groups]]Section groups
1491~~~~~~~~~~~~~~~~~~~~~~~~
1492
1493[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
1494+
1495Controls whether newly created groups should be by default visible to
1496all registered users.
1497+
1498By default, false.
1499
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001500[[hooks]]Section hooks
Remy Bohmer203eea32012-02-19 21:21:36 +01001501~~~~~~~~~~~~~~~~~~~~~~
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001502
1503See also link:config-hooks.html[Hooks].
1504
1505[[hooks.path]]hooks.path::
1506+
1507Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
1508
1509[[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
1510+
1511Optional filename for the patchset created hook, if not specified then
1512`patchset-created` will be used.
1513
David Pursehoused556c192012-06-12 18:34:37 +09001514[[hooks.draftPublishedHook]]hooks.draftPublishedHook::
1515+
1516Optional filename for the draft published hook, if not specified then
1517`draft-published` will be used.
1518
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001519[[hooks.commentAddedHook]]hooks.commentAddedHook::
1520+
1521Optional filename for the comment added hook, if not specified then
1522`comment-added` will be used.
1523
1524[[hooks.changeMergedHook]]hooks.changeMergedHook::
1525+
1526Optional filename for the change merged hook, if not specified then
1527`change-merged` will be used.
1528
David Pursehousef9f3b272012-09-28 19:58:59 +09001529[[hooks.mergeFailedHook]]hooks.mergeFailedHook::
1530+
1531Optional filename for the merge failed hook, if not specified then
1532`merge-failed` will be used.
1533
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001534[[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
1535+
1536Optional filename for the change abandoned hook, if not specified then
1537`change-abandoned` will be used.
1538
David Pursehousea93c9302012-06-15 16:29:26 +09001539[[hooks.changeRestoredHook]]hooks.changeRestoredHook::
1540+
1541Optional filename for the change restored hook, if not specified then
1542`change-restored` will be used.
1543
1544[[hooks.refUpdatedHook]]hooks.refUpdatedHook::
1545+
1546Optional filename for the ref updated hook, if not specified then
1547`ref-updated` will be used.
1548
David Pursehouse2336bd82012-09-21 12:50:19 +09001549[[hooks.reviewerAddedHook]]hooks.reviewerAddedHook::
1550+
1551Optional filename for the reviewer added hook, if not specified then
1552`reviewer-added` will be used.
1553
David Pursehouseba3e28d2013-07-12 14:48:51 +09001554[[hooks.topicChangedHook]]hooks.topicChangedHook::
1555+
1556Optional filename for the topic changed hook, if not specified then
1557`topic-changed` will be used.
1558
David Pursehousea93c9302012-06-15 16:29:26 +09001559[[hooks.claSignedHook]]hooks.claSignedHook::
1560+
1561Optional filename for the CLA signed hook, if not specified then
1562`cla-signed` will be used.
1563
Chris Harrisf736d6c2012-11-21 09:35:56 -05001564[[hooks.refUpdateHook]]hooks.refUpdateHook::
1565+
1566Optional filename for the ref update hook, if not specified then
1567`ref-update` will be used.
1568
1569[[hooks.syncHookTimeout]]hooks.syncHookTimeout::
David Pursehouse6fdc8d92012-11-28 12:34:18 +09001570+
1571Optional timeout value in seconds for synchronous hooks, if not specified
Chris Harrisf736d6c2012-11-21 09:35:56 -05001572then 30 seconds will be used.
1573
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001574[[http]]Section http
1575~~~~~~~~~~~~~~~~~~~~
1576
1577[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001578+
1579URL of the proxy server when making outgoing HTTP
1580connections for OpenID login transactions. Syntax
1581should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001582
1583[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001584+
1585Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001586This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001587appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001588
1589[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001590+
1591Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001592This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001593appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001594
1595
1596[[httpd]]Section httpd
1597~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001598
1599The httpd section configures the embedded servlet container.
1600
1601[[httpd.listenUrl]]httpd.listenUrl::
1602+
1603Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001604connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001605on all local addresses. A context path may optionally be included,
1606placing Gerrit Code Review's web address within a subdirectory of
1607the server.
1608+
1609Multiple protocol schemes are supported:
1610+
1611* `http://`'hostname'`:`'port'
1612+
1613Plain-text HTTP protocol. If port is not supplied, defaults to 80,
1614the standard HTTP port.
1615+
1616* `https://`'hostname'`:`'port'
1617+
1618SSL encrypted HTTP protocol. If port is not supplied, defaults to
1619443, the standard HTTPS port.
1620+
1621Externally facing production sites are encouraged to use a reverse
1622proxy configuration and `proxy-https://` (below), rather than using
1623the embedded servlet container to implement the SSL processing.
1624The proxy server with SSL support is probably easier to configure,
1625provides more configuration options to control cipher usage, and
1626is likely using natively compiled encryption algorithms, resulting
1627in higher throughput.
1628+
1629* `proxy-http://`'hostname'`:`'port'
1630+
1631Plain-text HTTP relayed from a reverse proxy. If port is not
1632supplied, defaults to 8080.
1633+
1634Like http, but additional header parsing features are
1635enabled to honor X-Forwarded-For, X-Forwarded-Host and
1636X-Forwarded-Server. These headers are typically set by Apache's
1637link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
1638+
1639* `proxy-https://`'hostname'`:`'port'
1640+
1641Plain text HTTP relayed from a reverse proxy that has already
1642handled the SSL encryption/decryption. If port is not supplied,
1643defaults to 8080.
1644+
1645Behaves exactly like proxy-http, but also sets the scheme to assume
1646'https://' is the proper URL back to the server.
1647
1648+
1649If multiple values are supplied, the daemon will listen on all
1650of them.
1651+
1652By default, http://*:8080.
1653
1654[[httpd.reuseAddress]]httpd.reuseAddress::
1655+
1656If true, permits the daemon to bind to the port even if the port
1657is already in use. If false, the daemon ensures the port is not
1658in use before starting. Busy sites may need to set this to true
1659to permit fast restarts.
1660+
1661By default, true.
1662
1663[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
1664+
1665Size, in bytes, of the buffer used to parse the HTTP headers of an
1666incoming HTTP request. The entire request headers, including any
1667cookies sent by the browser, must fit within this buffer, otherwise
1668the server aborts with the response '413 Request Entity Too Large'.
1669+
1670One buffer of this size is allocated per active connection.
1671Allocating a buffer that is too large wastes memory that cannot be
1672reclaimed, allocating a buffer that is too small may cause unexpected
1673errors caused by very long Referer URLs or large cookie values.
1674+
1675By default, 16384 (16 K), which is sufficient for most OpenID and
1676other web-based single-sign-on integrations.
1677
Chulho Yangb72ff8f2013-07-04 02:35:53 -04001678[[httpd.sslCrl]]httpd.sslCrl::
1679+
1680Path of the certificate revocation list file in PEM format. This
1681crl file is optional, and available for CLIENT_SSL_CERT_LDAP
1682authentication.
1683+
1684To create and view a crl using openssl:
1685+
1686----
1687openssl ca -gencrl -out crl.pem
1688openssl crl -in crl.pem -text
1689----
1690+
1691If not absolute, the path is resolved relative to `$site_path`.
1692+
1693By default, `$site_path/etc/crl.pem`.
1694
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001695[[httpd.sslKeyStore]]httpd.sslKeyStore::
1696+
1697Path of the Java keystore containing the server's SSL certificate
1698and private key. This keystore is required for `https://` in URL.
1699+
1700To create a self-signed certificate for simple internal usage:
1701+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001702----
1703keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1704chmod 600 keystore
1705----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001706+
1707If not absolute, the path is resolved relative to `$site_path`.
1708+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08001709By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001710
1711[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
1712+
1713Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09001714Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001715doesn't want to enable one.
1716+
1717If set to the empty string the embedded server will prompt for the
1718password during startup.
1719+
1720By default, `gerrit`.
1721
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001722[[httpd.requestLog]]httpd.requestLog::
1723+
1724Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
1725If enabled, an NCSA combined log format request log file is written
1726out by the internal HTTP daemon.
1727+
1728By default, true if httpd.listenUrl uses http:// or https://,
1729and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
1730
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001731[[httpd.acceptorThreads]]httpd.acceptorThreads::
1732+
1733Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09001734connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001735+
1736By default, 2, which should be suitable for most high-traffic sites.
1737
1738[[httpd.minThreads]]httpd.minThreads::
1739+
1740Minimum number of spare threads to keep in the worker thread pool.
1741This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09001742multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001743+
1744By default, 5, suitable for most lower-volume traffic sites.
1745
1746[[httpd.maxThreads]]httpd.maxThreads::
1747+
1748Maximum number of threads to permit in the worker thread pool.
1749+
1750By default 25, suitable for most lower-volume traffic sites.
1751
1752[[httpd.maxQueued]]httpd.maxQueued::
1753+
1754Maximum number of client connections which can enter the worker
1755thread pool waiting for a worker thread to become available.
17560 disables the queue and permits infinite number of connections.
1757+
1758By default 50.
1759
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001760[[httpd.maxWait]]httpd.maxWait::
1761+
David Pursehouse221d4f62012-06-08 17:38:08 +09001762Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001763thread to handle a project clone, fetch or push request over the
1764smart HTTP transport.
1765+
1766Values should use common unit suffixes to express their setting:
1767+
1768* s, sec, second, seconds
1769* m, min, minute, minutes
1770* h, hr, hour, hours
1771* d, day, days
1772* w, week, weeks (`1 week` is treated as `7 days`)
1773* mon, month, months (`1 month` is treated as `30 days`)
1774* y, year, years (`1 year` is treated as `365 days`)
1775
1776+
1777If a unit suffix is not specified, `minutes` is assumed. If 0
1778is supplied, the maximum age is infinite and connections will not
1779abort until the client disconnects.
1780+
1781By default, 5 minutes.
1782
Luca Milanesioce7b7452013-06-18 11:40:49 +01001783[[httpd.filterClass]]httpd.filterClass::
1784+
1785Class that implements the javax.servlet.Filter interface
1786for filtering any HTTP related traffic going through the Gerrit
1787HTTP protocol.
1788Class is loaded and configured in the Gerrit Jetty container
1789and run in front of all Gerrit URL handlers, allowing the filter
1790to inspect, modify, allow or reject each request.
1791It needs to be provided as JAR library
1792under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
1793loader and cannot be dynamically loaded by a plugin.
1794+
1795Failing to load the Filter class would result in a Gerrit start-up
1796failure, as this class is supposed to provide mandatory filtering
1797in front of Gerrit HTTP protocol.
1798+
David Pursehouse42f42042013-08-01 14:02:25 +09001799Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01001800of an Apache HTTP proxy layer as security enforcement on top of Gerrit
1801by returning a trusted username as HTTP Header.
1802+
1803Example of using a security library secure.jar under $GERRIT_SITE/lib
1804that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
1805a trusted username in the `TRUSTED_USER` HTTP Header:
1806
1807----
1808[auth]
1809type = HTTP
1810httpHeader = TRUSTED_USER
1811
1812[http]
1813filterClass = org.anyorg.MySecureFilter
1814----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001815
Juan Hernandezec512562013-08-06 16:30:50 +02001816[[httpd.robotsFile]]httpd.robotsFile::
1817+
1818Location of an external robots.txt file to be used instead of the one
1819bundled with the .war of the application.
1820+
1821If not absolute, the path is resolved relative to `$site_path`.
1822+
1823If the file doesn't exist or can't be read the default robots.txt file
1824bundled with the .war will be used instead.
1825
David Pursehouse6d458432013-08-23 16:17:18 +09001826[[index]]Section index
1827~~~~~~~~~~~~~~~~~~~~~~
1828
1829The index section configures the secondary index.
1830
David Pursehouse3fc5ee32014-03-17 18:35:32 +09001831Note that after enabling the secondary index, the index must be built
1832using the link:pgm-reindex.html[reindex program] before restarting the
1833Gerrit server.
1834
1835Open and closed changes are indexed in separate indexes named
1836'changes_open' and 'changes_closed' respectively.
1837
David Pursehouse6d458432013-08-23 16:17:18 +09001838[[index.type]]index.type::
1839+
1840Type of secondary indexing employed by Gerrit. The supported
1841values are:
1842+
1843* `LUCENE`
1844+
1845A link:http://lucene.apache.org/[Lucene] index is used.
1846+
1847* `SOLR`
1848+
1849A link:http://lucene.apache.org/solr/[Solr] index is used.
1850+
1851* `SQL`
1852+
1853No secondary index. Not all query operators are supported. Other
1854query operators are routed through the standard SQL query engine.
1855
1856+
1857By default, `SQL`.
David Pursehouse15c43282013-12-04 13:32:59 +09001858
David Pursehouse904db302014-03-17 18:55:38 +09001859[[index.threads]]index.threads::
1860+
1861Determines the number of threads to use for indexing.
1862+
1863Defaults to 1 if not set, or set to a negative value.
1864
David Pursehouse00c82142014-01-22 17:41:09 +09001865[[index.name.ramBufferSize]]index.name.ramBufferSize::
1866+
1867Only used when the type is `LUCENE`.
1868+
1869Determines the amount of RAM that may be used for buffering added documents
1870and deletions before they are flushed to the index. See the
1871link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
1872Lucene documentation] for further details.
1873+
1874Defaults to 16M.
1875
1876[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
1877+
1878Only used when the type is `LUCENE`.
1879+
1880Determines the minimal number of documents required before the buffered
1881in-memory documents are flushed to the index. Large values generally
1882give faster indexing. See the
1883link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
1884Lucene documentation] for further details.
1885+
1886Defaults to -1, meaning no maximum is set and the writer will flush
1887according to RAM usage.
1888
Dave Borowitzd08b0452014-02-13 11:56:03 -08001889[[index.name.commitWithin]]index.name.commitWithin::
1890+
1891Only used when the type is `LUCENE`.
1892+
1893Determines the period at which changes are automatically committed to
1894stable store on disk. This is a costly operation and may block
1895additional index writes, so lower with caution.
1896+
1897If zero or negative, changes are committed after every write. This is
1898very costly but may be useful if offline reindexing is infeasible, or
1899for development servers.
1900+
David Pursehouse9354c1a2014-03-22 12:23:43 -07001901Values can be specified using standard time unit abbreviations (`ms`,
1902`sec`, `min`, etc.).
1903+
David Pursehouse3cd6de02014-03-14 16:13:56 +09001904This setting also applies when running the reindex program. If it is
1905configured to commit on every write, this will cause reindex to take
1906an unnecessarily long time to complete on sites that have a lot of
1907changes. It is recommended to temporarily set a higher value while
1908running reindex.
1909
Dave Borowitzd08b0452014-02-13 11:56:03 -08001910Defaults to 300000 ms (5 minutes).
1911
David Pursehouse00c82142014-01-22 17:41:09 +09001912Sample index configuration:
1913----
1914[index]
1915 type = LUCENE
1916
1917[index "changes_open"]
1918 ramBufferSize = 60 m
1919 maxBufferedDocs = 3000
1920
1921[index "changes_closed"]
1922 ramBufferSize = 20 m
1923 maxBufferedDocs = 500
1924----
1925
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001926[[ldap]]Section ldap
1927~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001928
David Pursehouse221d4f62012-06-08 17:38:08 +09001929LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001930`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09001931detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001932implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001933
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001934An example LDAP configuration follows, and then discussion of
1935the parameters introduced here. Suitable defaults for most
1936parameters are automatically guessed based on the type of server
1937detected during startup. The guessed defaults support both
1938link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
1939Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001940
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001941----
1942[ldap]
1943 server = ldap://ldap.example.com
1944
1945 accountBase = ou=people,dc=example,dc=com
1946 accountPattern = (&(objectClass=person)(uid=${username}))
1947 accountFullName = displayName
1948 accountEmailAddress = mail
1949
1950 groupBase = ou=groups,dc=example,dc=com
1951 groupMemberPattern = (&(objectClass=group)(member=${dn}))
1952----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001953
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001954[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001955+
1956URL of the organization's LDAP server to query for user information
1957and group membership from. Must be of the form `ldap://host` or
1958`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001959+
David Pursehouse42f42042013-08-01 14:02:25 +09001960If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001961ensure the end user's plaintext password is transmitted only over
1962an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001963
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001964[[ldap.sslVerify]]ldap.sslVerify::
1965+
1966If false and ldap.server is an `ldaps://` style URL, Gerrit
1967will not verify the server certificate when it connects to
1968perform a query.
1969+
1970By default, true, requiring the certificate to be verified.
1971
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001972[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001973+
1974_(Optional)_ Username to bind to the LDAP server with. If not set,
1975an anonymous connection to the LDAP server is attempted.
1976
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001977[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001978+
1979_(Optional)_ Password for the user identified by `ldap.username`.
1980If not set, an anonymous (or passwordless) connection to the LDAP
1981server is attempted.
1982
Ben Wu0410a152010-06-04 16:17:24 +08001983[[ldap.referral]]ldap.referral::
1984+
1985_(Optional)_ How an LDAP referral should be handled if it is
1986encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05001987automatically follow any referrals, or `ignore` to ignore the
1988referrals.
Ben Wu0410a152010-06-04 16:17:24 +08001989+
1990By default, `ignore`.
1991
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001992[[ldap.readTimeout]]ldap.readTimeout::
1993+
1994_(Optional)_ The read timeout for an LDAP operation. The value is
1995in the usual time-unit format like "1 s", "100 ms", etc...
1996A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09001997threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001998+
1999By default there is no timeout and Gerrit will wait for the LDAP
2000server to respond until the TCP connection times out.
2001
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002002[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002003+
2004Root of the tree containing all user accounts. This is typically
2005of the form `ou=people,dc=example,dc=com`.
2006
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002007[[ldap.accountScope]]ldap.accountScope::
2008+
2009Scope of the search performed for accounts. Must be one of:
2010+
2011* `one`: Search only one level below accountBase, but not recursive
2012* `sub` or `subtree`: Search recursively below accountBase
2013* `base` or `object`: Search exactly accountBase; probably not desired
2014
2015+
2016Default is `subtree` as many directories have several levels.
2017
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002018[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002019+
2020Query pattern to use when searching for a user account. This may be
2021any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002022`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002023`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002024that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002025the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002026the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002027+
2028This pattern is used to search the objects contained directly under
2029the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002030is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002031setting depends on the LDAP schema used by the directory server.
2032+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002033Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002034and `(&(objectClass=user)(sAMAccountName=${username}))`
2035for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002036
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002037[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002038+
2039_(Optional)_ Name of an attribute on the user account object which
2040contains the initial value for the user's full name field in Gerrit.
2041Typically this is the `displayName` property in LDAP, but could
2042also be `legalName` or `cn`.
2043+
David Pursehouse221d4f62012-06-08 17:38:08 +09002044Attribute values may be concatenated with literal strings. For
2045example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002046`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002047+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002048If set, users will be unable to modify their full name field, as
2049Gerrit will populate it only from the LDAP data.
2050+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002051Default is `displayName` for RFC 2307 servers,
2052and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002053
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002054[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002055+
2056_(Optional)_ Name of an attribute on the user account object which
2057contains the user's Internet email address, as defined by this
2058LDAP server.
2059+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002060Attribute values may be concatenated with literal strings,
2061for example to set the email address to the lowercase form
2062of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002063`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002064+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002065If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002066but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002067and select a different preferred email address.
2068+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002069Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002070
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002071[[ldap.accountSshUserName]]ldap.accountSshUserName::
2072+
2073_(Optional)_ Name of an attribute on the user account object which
2074contains the initial value for the user's SSH username field in
2075Gerrit. Typically this is the `uid` property in LDAP, but could
2076also be `cn`. Administrators should prefer to match the attribute
2077corresponding to the user's workstation username, as this is what
2078SSH clients will default to.
2079+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002080Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002081an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002082force the value of sAMAccountName, if defined, to be all lowercase.
2083The suffix `.toUpperCase` can be used for the other direction.
2084The suffix `.localPart` can be used to split attribute values of
2085the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002086example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002087+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002088If set, users will be unable to modify their SSH username field, as
2089Gerrit will populate it only from the LDAP data.
2090+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002091Default is `uid` for RFC 2307 servers,
2092and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002093
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002094[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002095+
2096_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002097contains the groups the user is part of. Typically used for Active
2098Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002099+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002100Default is unset for RFC 2307 servers (disabled)
2101and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002102
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002103[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002104+
2105Root of the tree containing all group objects. This is typically
2106of the form `ou=groups,dc=example,dc=com`.
2107
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002108[[ldap.groupScope]]ldap.groupScope::
2109+
2110Scope of the search performed for group objects. Must be one of:
2111+
2112* `one`: Search only one level below groupBase, but not recursive
2113* `sub` or `subtree`: Search recursively below groupBase
2114* `base` or `object`: Search exactly groupBase; probably not desired
2115
2116+
2117Default is `subtree` as many directories have several levels.
2118
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002119[[ldap.groupPattern]]ldap.groupPattern::
2120+
2121Query pattern used when searching for an LDAP group to connect
2122to a Gerrit group. This may be any valid LDAP query expression,
2123including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002124`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002125group owner.
2126+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002127Default is `(cn=${groupname})` for RFC 2307,
2128and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002129
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002130[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002131+
2132Query pattern to use when searching for the groups that a user
2133account is currently a member of. This may be any valid LDAP query
2134expression, including the standard `(&...)` and `(|...)` operators.
2135+
David Pursehouse42f42042013-08-01 14:02:25 +09002136If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002137replaced with a parameter set to the username that was supplied
2138by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002139such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002140corresponding attribute (in this case, `fooBarAttribute`) as read
2141from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002142Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002143+
Scott Dial50457502013-08-11 16:52:51 -04002144Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2145RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002146
Auke Schrijnen57809132012-09-26 21:05:39 +02002147[[ldap.groupName]]ldap.groupName::
2148+
David Pursehouse39489ae2012-10-12 13:50:04 +09002149_(Optional)_ Name of the attribute on the group object which contains
2150the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002151+
David Pursehouse39489ae2012-10-12 13:50:04 +09002152Typically the attribute name is `cn` for RFC 2307 and Active Directory
2153servers. For other servers the attribute name may differ, for example
2154`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002155+
David Pursehouse39489ae2012-10-12 13:50:04 +09002156It is also possible to specify a literal string containing a pattern of
2157attribute values. For example to create a Gerrit group name consisting of
2158LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2159+
2160Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002161
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002162[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2163+
2164Converts the local username, that is used to login into the Gerrit
2165WebUI, to lower case before doing the LDAP authentication. By setting
2166this parameter to true, a case insensitive login to the Gerrit WebUI
2167can be achieved.
2168+
2169If set, it must be ensured that the local usernames for all existing
2170accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002171local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002172anymore. The local usernames for the existing accounts can be
2173converted to lower case by running the server program
2174link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2175Please be aware that the conversion of the local usernames to lower
2176case can't be undone. For newly created accounts the local username
2177will be directly stored in lower case.
2178+
2179By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002180
Robin Rosenberga3baed02012-10-14 14:09:32 +02002181[[ldap.authentication]]ldap.authentication::
2182+
2183Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2184Gerrit will use Kerberos. To use kerberos the
2185`java.security.auth.login.config` system property must point to a
2186login to a JAAS configuration file and, if Java 6 is used, the system
2187property `java.security.krb5.conf` must point to the appropriate
2188krb5.ini file with references to the KDC.
2189
2190Typical jaas.conf.
2191
2192----
2193KerberosLogin {
2194 com.sun.security.auth.module.Krb5LoginModule
2195 required
2196 useTicketCache=true
2197 doNotPrompt=true
2198 renewTGT=true;
2199};
2200----
2201
2202See Java documentation on how to create the krb5.ini file.
2203
2204Note the `renewTGT` property to make sure the TGT does not expire,
2205and `useTicketCache` to use the TGT supplied by the operating system. As
2206the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002207to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002208
2209On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2210must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2211have local administrator privileges.
2212
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002213[[mimetype]]Section mimetype
2214~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002215
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002216[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002217+
2218If set to true, files with the MIME type `<name>` will be sent as
2219direct downloads to the user's browser, rather than being wrapped up
2220inside of zipped archives. The type name may be a complete type
Edwin Kempincdb0e002011-09-08 14:23:30 +02002221name, e.g. `image/gif`, a generic media type, e.g. `image/*`,
2222or the wildcard `*/*` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002223+
2224By default, false for all MIME types.
2225
2226Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002227----
2228[mimetype "image/*"]
2229 safe = true
2230
2231[mimetype "application/pdf"]
2232 safe = true
2233
2234[mimetype "application/msword"]
2235 safe = true
2236
2237[mimetype "application/vnd.ms-excel"]
2238 safe = true
2239----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002240
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002241
2242[[pack]]Section pack
2243~~~~~~~~~~~~~~~~~~~~
2244Global settings controlling how Gerrit Code Review creates pack
2245streams for Git clients running clone, fetch, or pull. Most of these
2246variables are per-client request, and thus should be carefully set
2247given the expected concurrent request load and available CPU and
2248memory resources.
2249
2250[[pack.deltacompression]]pack.deltacompression::
2251+
2252If true, delta compression between objects is enabled. This may
2253result in a smaller overall transfer for the client, but requires
2254more server memory and CPU time.
2255+
2256False (off) by default, matching Gerrit Code Review 2.1.4.
2257
2258[[pack.threads]]pack.threads::
2259+
2260Maximum number of threads to use for delta compression (if enabled).
2261This is per-client request. If set to 0 then the number of CPUs is
2262auto-detected and one thread per CPU is used, per client request.
2263+
2264By default, 1.
2265
2266
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002267[[plugins]]Section plugins
2268~~~~~~~~~~~~~~~~~~~~~~~~~~
2269
2270[[plugins.checkFrequency]]plugins.checkFrequency::
2271+
2272How often plugins should be examined for new plugins to load, removed
2273plugins to be unloaded, or updated plugins to be reloaded. Values can
2274be specified using standard time unit abbreviations ('ms', 'sec',
2275'min', etc.).
2276+
2277If set to 0, automatic plugin reloading is disabled. Administrators
2278may force reloading with link:cmd-plugin.html[gerrit plugin reload].
2279+
2280Default is 1 minute.
2281
2282
lincoln2be11602010-07-05 10:53:25 -03002283[[receive]]Section receive
2284~~~~~~~~~~~~~~~~~~~~~~~~~~
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002285This section is used to set who can execute the 'receive-pack' and
2286to limit the maximum Git object size that 'receive-pack' will accept.
2287'receive-pack' is what runs on the server during a user's push or
Dave Borowitz234734a2012-03-01 14:22:29 -08002288repo upload command. It also contains some advanced options for tuning the
2289behavior of Gerrit's 'receive-pack' mechanism.
lincoln2be11602010-07-05 10:53:25 -03002290
2291----
2292[receive]
2293 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2294 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002295 maxObjectSizeLimit = 40 m
lincoln2be11602010-07-05 10:53:25 -03002296----
2297
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08002298[[receive.checkMagicRefs]]receive.checkMagicRefs::
2299+
2300If true, Gerrit will verify the destination repository has
2301no references under the magic 'refs/drafts', 'refs/for', or
2302'refs/publish' branch namespaces. Names under these locations
2303confuse clients when trying to upload code reviews so Gerrit
2304requires them to be empty.
2305+
2306If false Gerrit skips the sanity check and assumes administrators
2307have ensured the repository does not contain any magic references.
2308Setting to false to skip the check can decrease latency during push.
2309+
2310Default is true.
2311
Gustaf Lundh9062fd62013-02-14 17:23:11 +01002312[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
2313+
2314If set to true, Gerrit will validate that all referenced objects that
2315are not included in the received pack are reachable by the user.
2316+
2317Carrying out this check on gits with many refs and commits can be a
2318very CPU-heavy operation. For non public Gerrit-servers this check may
2319be overkill.
2320+
2321Only disable this check if you trust the clients not to forge SHA1
2322references to access commits intended to be hidden from the user.
2323+
2324Default is true.
2325
lincoln2be11602010-07-05 10:53:25 -03002326[[receive.allowGroup]]receive.allowGroup::
2327+
2328Name of the groups of users that are allowed to execute
2329'receive-pack' on the server. One or more groups can be set.
2330+
2331If no groups are added, any user will be allowed to execute
2332'receive-pack' on the server.
2333
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002334[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
2335+
2336Maximum allowed Git object size that 'receive-pack' will accept.
2337If an object is larger than the given size the pack-parsing will abort
2338and the push operation will fail. If set to zero then there is no
2339limit.
2340+
David Pursehouse221d4f62012-06-08 17:38:08 +09002341Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002342from pushing objects which are too large to Gerrit.
2343+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07002344This setting can also be set in the `project.config`
2345link:config-project-config.html[receive.maxObjectSizeLimit] in order
2346to further reduce the global setting. The project specific setting is
2347only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02002348+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002349Default is zero.
2350+
2351Common unit suffixes of 'k', 'm', or 'g' are supported.
2352
Dave Borowitz234734a2012-03-01 14:22:29 -08002353[[receive.threadPoolSize]]receive.threadPoolSize::
2354+
2355Maximum size of the thread pool in which the change data in received packs is
2356processed.
2357+
2358Defaults to the number of available CPUs according to the Java runtime.
2359
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002360[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2361+
2362Number of threads to perform change creation or patch set updates
2363concurrently. Each thread uses its own database connection from
2364the database connection pool, and if all threads are busy then
2365main receive thread will also perform a change creation or patch
2366set update.
2367+
2368Defaults to 1, using only the main receive thread. This feature is for
David Pursehouse92463562013-06-24 10:16:28 +09002369databases with very high latency that can benefit from concurrent
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002370operations when multiple changes are impacted at once.
2371
Dave Borowitz1c401362012-03-02 17:39:17 -08002372[[receive.timeout]]receive.timeout::
2373+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002374Overall timeout on the time taken to process the change data in
2375received packs. Only includes the time processing Gerrit changes
2376and updating references, not the time to index the pack. Values can
2377be specified using standard time unit abbreviations ('ms', 'sec',
2378'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08002379+
David Pursehouse92463562013-06-24 10:16:28 +09002380Default is 2 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002381is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08002382
lincoln2be11602010-07-05 10:53:25 -03002383
Hugo Josefson072b4702010-04-21 19:27:11 +02002384[[repository]]Section repository
2385~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2386Repositories in this sense are the same as projects.
2387
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002388In the following example configuration `Registered Users` is set
2389to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02002390
2391----
2392[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02002393 ownerGroup = Registered Users
2394----
2395
2396[NOTE]
2397Currently only the repository name `*` is supported.
2398This is a wildcard designating all repositories.
2399
Hugo Josefson072b4702010-04-21 19:27:11 +02002400[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
2401+
2402A name of a group which exists in the database. Zero, one or many
2403groups are allowed. Each on its own line. Groups which don't exist
2404in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02002405
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002406[[rules]]Section rules
2407~~~~~~~~~~~~~~~~~~~~~~
2408
2409[[rules.enable]]rules.enable::
2410+
Matt Baker8ce12fc2013-11-26 21:43:12 -07002411If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002412project's refs/meta/config branch, if present. When set to false,
2413only the default internal rules will be used.
2414+
2415Default is true, to execute project specific rules.
2416
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002417[[sendemail]]Section sendemail
2418~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002419
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002420[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07002421+
2422If false Gerrit will not send email messages, for any reason,
2423and all other properties of section sendemail are ignored.
2424+
2425By default, true, allowing notifications to be sent.
2426
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002427[[sendemail.from]]sendemail.from::
2428+
2429Designates what name and address Gerrit will place in the From
2430field of any generated email messages. The supported values are:
2431+
2432* `USER`
2433+
2434Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09002435Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002436classified as spam if the user's domain has SPF or DKIM enabled
2437and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
2438relay for that domain.
2439+
2440* `MIXED`
2441+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002442Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002443`review@example.com` is the same as <<user.email,user.email>>.
2444See below for a description of how the replacement is handled.
2445+
2446* `SERVER`
2447+
2448Gerrit will set the From header to the same name and address
2449it records in any commits Gerrit creates. This is set by
2450<<user.name,user.name>> and <<user.email,user.email>>, or guessed
2451from the local operating system.
2452+
2453* 'Code Review' `<`'review'`@`'example.com'`>`
2454+
2455If set to a name and email address in brackets, Gerrit will use
2456this name and email address for any messages, overriding the name
2457that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002458Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002459which is replaced by the Full Name of the current user.
2460
2461+
2462By default, MIXED.
2463
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002464[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002465+
2466Hostname (or IP address) of a SMTP server that will relay
2467messages generated by Gerrit to end users.
2468+
2469By default, 127.0.0.1 (aka localhost).
2470
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002471[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002472+
2473Port number of the SMTP server in sendemail.smtpserver.
2474+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08002475By default, 25, or 465 if smtpEncryption is 'ssl'.
2476
2477[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
2478+
2479Specify the encryption to use, either 'ssl' or 'tls'.
2480+
2481By default, 'none', indicating no encryption is used.
2482
2483[[sendemail.sslVerify]]sendemail.sslVerify::
2484+
2485If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
2486will not verify the server certificate when it connects to send
2487an email message.
2488+
2489By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002490
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002491[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002492+
2493User name to authenticate with, if required for relay.
2494
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002495[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002496+
2497Password for the account named by sendemail.smtpUser.
2498
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002499[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07002500+
2501If present, each value adds one entry to the whitelist of email
2502addresses that Gerrit can send email to. If set to a complete
2503email address, that one address is added to the white list.
2504If set to a domain name, any address at that domain can receive
2505email from Gerrit.
2506+
2507By default, unset, permitting delivery to any email address.
2508
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002509[[sendemail.includeDiff]]sendemail.includeDiff::
2510+
Bruce Zueb00ff32012-11-27 17:38:10 +08002511If true, new change emails and merged change emails from Gerrit
2512will include the complete unified diff of the change.
2513Variable maxmimumDiffSize places an upper limit on how large the
2514email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002515+
2516By default, false.
2517
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07002518[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
2519+
2520Largest size of unified diff output to include in an email. When
2521the diff exceeds this size the file paths will be listed instead.
2522Standard byte unit suffixes are supported.
2523+
2524By default, 256 KiB.
2525
Alex Blewitt9cca7402011-02-11 01:39:30 +00002526[[sendemail.importance]]sendemail.importance::
2527+
2528If present, emails sent from Gerrit will have the given level
2529of importance. Valid values include 'high' and 'low', which
2530email clients will render in different ways.
2531+
2532By default, unset, so no Importance header is generated.
2533
2534[[sendemail.expiryDays]]sendemail.expiryDays::
2535+
2536If present, emails sent from Gerrit will expire after the given
2537number of days. This will add the Expiry-Date header and
2538email clients may expire or expunge mails whose Expiry-Date
2539header is in the past. This should be a positive non-zero
2540number indicating how many days in the future the mails
2541should expire.
2542+
2543By default, unset, so no Expiry-Date header is generated.
2544
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002545
2546[[site]]Section site
2547~~~~~~~~~~~~~~~~~~~~
2548
2549[[site.checkUserAgent]]site.checkUserAgent::
2550+
2551If true the server checks the User-Agent HTTP header and sends the
2552correct JavaScript to the client as part of the initial page load.
2553This usually reduces a round-trip for the client, allowing the UI to
2554start more quickly. If false, a tiny JavaScript loader is sent to the
2555client instead to determine the correct code to use. Default is true.
2556
2557[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
2558+
2559If true the server checks the site header, footer and CSS files for
2560updated versions. If false, a server restart is required to change
2561any of these resources. Default is true, allowing automatic reloads.
2562
Shawn O. Pearce6bd04fd2012-04-05 14:39:22 -07002563[[site.enableDeprecatedQuery]]site.enableDeprecatedQuery::
2564+
2565If true the deprecated `/query` URL is available to return JSON
2566and text results for changes. If false, the URL is disabled and
2567returns 404 to clients. Default is true, enabling `/query`.
2568
Shawn O. Pearce521380a2012-05-11 14:57:56 -07002569[[ssh-alias]] Section ssh-alias
2570~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2571
2572Variables in section ssh-alias permit the site administrator to alias
2573another command from Gerrit or a plugin into the `gerrit` command
2574namespace. To alias `replication start` to `gerrit replicate`:
2575
2576----
2577[ssh-alias]
2578 replicate = replication start
2579----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002580
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002581[[sshd]] Section sshd
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07002582~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002583
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002584[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002585+
2586Specifies the local addresses the internal SSHD should listen
2587for connections on. The following forms may be used to specify
2588an address. In any form, `:'port'` may be omitted to use the
2589default of 29418.
2590+
2591* 'hostname':'port' (for example `review.example.com:29418`)
2592* 'IPv4':'port' (for example `10.0.0.1:29418`)
2593* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempincdb0e002011-09-08 14:23:30 +02002594* *:'port' (for example `*:29418`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002595
2596+
2597If multiple values are supplied, the daemon will listen on all
2598of them.
2599+
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07002600To disable the internal SSHD, set listenAddress to `off`.
2601+
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002602By default, *:29418.
2603
James Y Knight910bd862011-01-11 20:05:56 -05002604[[sshd.advertisedAddress]]sshd.advertisedAddress::
2605+
2606Specifies the addresses clients should be told to connect to.
2607This may differ from sshd.listenAddress if a firewall based port
2608redirector is being used, making Gerrit appear to answer on port
260922. The following forms may be used to specify an address. In any
2610form, `:'port'` may be omitted to use the default SSH port of 22.
2611+
2612* 'hostname':'port' (for example `review.example.com:22`)
2613* 'IPv4':'port' (for example `10.0.0.1:29418`)
2614* ['IPv6']:'port' (for example `[ff02::1]:29418`)
2615
2616+
2617If multiple values are supplied, the daemon will advertise all
2618of them.
2619+
2620By default, sshd.listenAddress.
2621
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002622[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002623+
2624If true, enables TCP keepalive messages to the other side, so
2625the daemon can terminate connections if the peer disappears.
2626+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02002627Only effective when `sshd.backend` is set to `MINA`.
2628+
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002629By default, true.
2630
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002631[[sshd.threads]]sshd.threads::
2632+
2633Number of threads to use when executing SSH command requests.
2634If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09002635are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002636+
2637By default, 1.5x the number of CPUs available to the JVM.
2638
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002639[[sshd.batchThreads]]sshd.batchThreads::
2640+
2641Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01002642link:access-control.html#non-interactive_users[non-interactive users].
2643If equals to 0, then all non-interactive requests are executed in the same
2644queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002645+
2646Any other value will remove the number of threads from the queue
2647allocated to interactive users, and create a separate thread pool
2648of the requested size, which will be used to run commands from
2649non-interactive users.
2650+
2651If the number of threads requested for non-interactive users is larger
2652than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09002653value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002654+
2655By default, 0.
2656
Kenny Root15ac1b82010-02-24 00:29:20 -08002657[[sshd.streamThreads]]sshd.streamThreads::
2658+
2659Number of threads to use when formatting events to asynchronous
2660streaming clients. Event formatting is multiplexed onto this thread
2661pool by a simple FIFO scheduling system.
2662+
2663By default, 1 plus the number of CPUs available to the JVM.
2664
Edwin Kempinb5df3b82011-10-10 11:31:14 +02002665[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07002666+
2667Number of threads used to parse a command line submitted by a client
2668over SSH for execution, create the internal data structures used by
2669that command, and schedule it for execution on another thread.
2670+
2671By default, 2.
2672
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002673[[sshd.maxAuthTries]]sshd.maxAuthTries::
2674+
2675Maximum number of authentication attempts before the server
2676disconnects the client. Each public key that a client has loaded
2677into its local agent counts as one auth request. Users can work
2678around the server's limit by loading less keys into their agent,
2679or selecting a specific key in their `~/.ssh/config` file with
2680the `IdentityFile` option.
2681+
2682By default, 6.
2683
2684[[sshd.loginGraceTime]]sshd.loginGraceTime::
2685+
2686Time in seconds that a client has to authenticate before the server
2687automatically terminates their connection. Values should use common
2688unit suffixes to express their setting:
2689+
2690* s, sec, second, seconds
2691* m, min, minute, minutes
2692* h, hr, hour, hours
2693* d, day, days
2694
2695+
2696By default, 2 minutes.
2697
Christian Aistleitner3d794592013-04-08 00:19:40 +02002698[[sshd.idleTimeout]]sshd.idleTimeout::
2699+
2700Time in seconds after which the server automatically terminates idle
2701connections (or 0 to disable closing of idle connections). Values
2702should use common unit suffixes to express their setting:
2703+
2704* s, sec, second, seconds
2705* m, min, minute, minutes
2706* h, hr, hour, hours
2707* d, day, days
2708
2709+
2710By default, 0.
2711
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002712[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
2713+
2714Maximum number of concurrent SSH sessions that a user account
2715may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09002716that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002717the number of commands a user may issue over a single connection.
2718If set to 0, there is no limit.
2719+
2720By default, 64.
2721
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002722[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002723+
2724Available ciphers. To permit multiple ciphers, specify multiple
2725`sshd.cipher` keys in the configuration file, one cipher name
2726per key. Cipher names starting with `+` are enabled in addition
2727to the default ciphers, cipher names starting with `-` are removed
2728from the default cipher set.
2729+
2730Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
27313des-cbc, none.
2732+
2733By default, all supported ciphers except `none` are available.
2734
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002735[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002736+
2737Available MAC (message authentication code) algorithms. To permit
2738multiple algorithms, specify multiple `sshd.mac` keys in the
2739configuration file, one MAC per key. MAC names starting with `+`
2740are enabled in addition to the default MACs, MAC names starting with
2741`-` are removed from the default MACs.
2742+
2743Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
2744+
2745By default, all supported MACs are available.
2746
Alex Blewitt7efb06f2013-04-01 12:46:48 -04002747[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
2748+
2749Enable kerberos authentication for SSH connections. To permit
2750kerberos authentication, the server must have a host principal
2751(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
2752This must be provisioned by the kerberos administrators, and is
2753typically installed into `/etc/krb5.keytab` on host machines.
2754+
2755The keytab must contain at least one `host/` principal, typically
2756using the host's canonical name. If it does not use the
2757canonical name, the `sshd.kerberosPrincipal` should be configured
2758with the correct name.
2759+
2760By default, not set and so kerberos authentication is not enabled.
2761
2762[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
2763+
2764If kerberos authentication is enabled with `sshd.kerberosKeytab`,
2765instead use the given principal name instead of the default.
2766If the principal does not begin with `host/` a warning message is
2767printed and may prevent successful authentication.
2768+
2769This may be useful if the host is behind an IP load balancer or
2770other SSH forwarding systems, since the principal name is constructed
2771by the client and must match for kerberos authentication to work.
2772+
2773By default, `host/canonical.host.name`
2774
Shawn Pearce35e97c22013-10-17 22:15:38 -07002775[[sshd.requestLog]]sshd.requestLog::
2776+
2777Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
2778If enabled, a request log file is written out by the SSH daemon.
2779+
2780By default, true.
2781
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002782[[suggest]] Section suggest
2783~~~~~~~~~~~~~~~~~~~~~~~~~~~
2784
Dave Borowitz1ae8c532012-03-09 18:39:40 -08002785[[suggest.accounts]]suggest.accounts::
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002786+
Dave Borowitz45baa892012-02-23 16:43:05 -08002787If `true`, visible user accounts (according to the value of
2788`accounts.visibility`) will be offered as completion suggestions
2789when adding a reviewer to a change, or a user to a group.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002790+
Dave Borowitz45baa892012-02-23 16:43:05 -08002791If `false`, account suggestion is disabled.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002792+
Dave Borowitz45baa892012-02-23 16:43:05 -08002793Older configurations may also have one of the `accounts.visibility`
2794values for this field, including `OFF` as a synonym for `NONE`. If
2795`accounts.visibility` is also set, that value overrides this one;
2796otherwise, this value applies to both `suggest.accounts` and
2797`accounts.visibility`.
Edwin Kempin42488812011-05-20 03:11:43 +02002798+
Dave Borowitz45baa892012-02-23 16:43:05 -08002799New configurations should prefer the boolean value for this field
2800and an enum value for `accounts.visibility`.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002801
Edwin Kempinf957dc22012-10-19 20:41:18 +02002802[[suggest.from]]suggest.from::
2803+
2804The number of characters that a user must have typed before suggestions
2805are provided. If set to 0, suggestions are always provided.
2806+
2807By default 0.
2808
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002809[[theme]] Section theme
2810~~~~~~~~~~~~~~~~~~~~~~~
2811
2812[[theme.backgroundColor]]theme.backgroundColor::
2813+
2814Background color for the page, and major data tables like the all
2815open changes table or the account dashboard. The value must be a
2816valid HTML hex color code, or standard color name.
2817+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002818By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002819
2820[[theme.topMenuColor]]theme.topMenuColor::
2821+
2822This is the color of the main menu bar at the top of the page.
2823The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08002824name.
2825+
2826By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002827
2828[[theme.textColor]]theme.textColor::
2829+
2830Text color for the page, and major data tables like the all
2831open changes table or the account dashboard. The value must be a
2832valid HTML hex color code, or standard color name.
2833+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002834By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002835
2836[[theme.trimColor]]theme.trimColor::
2837+
2838Primary color used as a background color behind text. This is
2839the color of the main menu bar at the top, of table headers,
2840and of major UI areas that we want to offset from other portions
2841of the page. The value must be a valid HTML hex color code, or
2842standard color name.
2843+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002844By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002845
2846[[theme.selectionColor]]theme.selectionColor::
2847+
2848Background color used within a trimColor area to denote the currently
2849selected tab, or the background color used in a table to denote the
2850currently selected row. The value must be a valid HTML hex color
2851code, or standard color name.
2852+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002853By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002854
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002855[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
2856+
2857Background color used for patch outdated messages. The value must be
2858a valid HTML hex color code, or standard color name.
2859+
Edwin Kempinb0347332012-07-17 10:14:32 +02002860By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002861
2862[[theme.tableOddRowColor]]theme.tableOddRowColor::
2863+
2864Background color for tables such as lists of open reviews for odd
2865rows. This is so you can have a different color for odd and even
2866rows of the table. The value must be a valid HTML hex color code,
2867or standard color name.
2868+
2869By default transparent.
2870
2871[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
2872+
2873Background color for tables such as lists of open reviews for even
2874rows. This is so you can have a different color for odd and even
2875rows of the table. The value must be a valid HTML hex color code,
2876or standard color name.
2877+
2878By default transparent.
2879
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07002880A different theme may be used for signed-in vs. signed-out user status
2881by using the "signed-in" and "signed-out" theme sections. Variables
2882not specified in a section are inherited from the default theme.
2883
2884----
2885[theme]
2886 backgroundColor = FFFFFF
2887[theme "signed-in"]
2888 backgroundColor = C0C0C0
2889[theme "signed-out"]
2890 backgroundColor = 00FFFF
2891----
2892
David Ostrovsky117c6032013-08-09 00:44:56 +02002893As example, here is the theme configuration to have the old green look:
2894
2895----
2896[theme]
2897 backgroundColor = FCFEEF
2898 textColor = 000000
2899 trimColor = D4E9A9
2900 selectionColor = FFFFCC
2901 topMenuColor = D4E9A9
2902 changeTableOutdatedColor = F08080
2903[theme "signed-in"]
2904 backgroundColor = FFFFFF
2905----
2906
Goran Lungberg04132a12010-06-15 17:20:37 -07002907[[trackingid]] Section trackingid
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002908~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Goran Lungberg04132a12010-06-15 17:20:37 -07002909
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07002910Tagged footer lines containing references to external
2911tracking systems, parsed out of the commit message and
Shawn Pearceff61c8a2013-10-07 19:35:53 -07002912saved in Gerrit's database.
2913
2914After making changes to this section, existing changes
2915must be reindexed with link:pgm-reindex.html[reindex]
2916if index.type is `LUCENE` or `SOLR`; or with
2917link:pgm-ScanTrackingIds.html[ScanTrackingIds] if index.type
2918is unset or `SQL`.
Goran Lungberg04132a12010-06-15 17:20:37 -07002919
Edwin Kempinbb421f12011-08-25 11:19:00 +02002920The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002921bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07002922
2923----
2924[trackingid "jira-bug"]
2925 footer = Bugfix:
2926 match = JRA\\d{2,8}
2927 system = JIRA
2928
2929[trackingid "jira-feature"]
2930 footer = Feature
2931 match = JRA(\\d{2,8})
2932 system = JIRA
2933----
2934
2935[[trackingid.name.footer]]trackingid.<name>.footer::
2936+
2937A prefix tag that identify the footer line to parse for tracking ids.
Kevin Degi9af42ea2011-08-01 15:54:42 -06002938Several trackingid entries can have the same footer tag. A single
2939trackingid entry can have multiple footer tags. If multiple footer
2940tags are specified, each tag will be parsed separately.
Goran Lungberg04132a12010-06-15 17:20:37 -07002941(the trailing ":" is optional)
2942
2943[[trackingid.name.match]]trackingid.<name>.match::
2944+
Magnus Bäcke5611832011-02-02 08:57:15 +01002945A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
2946Java regular expression (java.util.regex)] used to match the
2947external tracking id part of the footer line. The match can
2948result in several entries in the DB. If grouping is used in the
2949regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01002950Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07002951+
2952The configuration file parser eats one level of backslashes, so the
2953character class `\s` requires `\\s` in the configuration file. The
2954parser also terminates the line at the first `#`, so a match
2955expression containing # must be wrapped in double quotes.
2956
2957[[trackingid.name.system]]trackingid.<name>.system::
2958+
David Pursehouse221d4f62012-06-08 17:38:08 +09002959The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07002960It is possible to have several trackingid entries for the same
2961tracking system.
2962
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07002963[[transfer]] Section transfer
2964~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2965
2966[[transfer.timeout]]transfer.timeout::
2967+
2968Number of seconds to wait for a single network read or write
2969to complete before giving up and declaring the remote side is
2970not responding. If 0, there is no timeout, and this server will
2971wait indefinitely for a transfer to finish.
2972+
2973A timeout should be large enough to mostly transfer the objects to
2974the other side. 1 second may be too small for larger projects,
2975especially over a WAN link, while 10-30 seconds is a much more
2976reasonable timeout value.
2977+
2978Defaults to 0 seconds, wait indefinitely.
2979
lincoln2be11602010-07-05 10:53:25 -03002980
2981[[upload]]Section upload
Remy Bohmer203eea32012-02-19 21:21:36 +01002982~~~~~~~~~~~~~~~~~~~~~~~~
lincoln2be11602010-07-05 10:53:25 -03002983Sets the group of users allowed to execute 'upload-pack' on the
2984server, 'upload-pack' is what runs on the server during a user's
2985fetch, clone or repo sync command.
2986
2987----
2988[upload]
2989 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2990 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
2991----
2992
2993[[upload.allowGroup]]upload.allowGroup::
2994+
2995Name of the groups of users that are allowed to execute 'upload-pack'
2996on the server. One or more groups can be set.
2997+
2998If no groups are added, any user will be allowed to execute
2999'upload-pack' on the server.
3000
3001
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07003002[[user]] Section user
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07003003~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003004
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003005[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003006+
3007Name that Gerrit calls itself in Git when it creates a new Git
3008commit, such as a merge during change submission.
3009+
3010By default this is "Gerrit Code Review".
3011
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003012[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003013+
3014Email address that Gerrit refers to itself as when it creates a
3015new Git commit, such as a merge commit during change submission.
3016+
3017If not set, Gerrit generates this as "gerrit@`hostname`", where
3018`hostname` is the hostname of the system Gerrit is running on.
3019+
3020By default, not set, generating the value at startup.
3021
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003022[[user.anonymousCoward]]user.anonymousCoward::
3023+
David Pursehouse13b21902013-10-16 12:59:18 +09003024Username that is displayed in the Gerrit WebUI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003025notifications if the full name of the user is not set.
3026+
3027By default "Anonymous Coward" is used.
3028
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003029
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003030File `etc/secure.config`
Remy Bohmer203eea32012-02-19 21:21:36 +01003031------------------------
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003032The optional file `'$site_path'/etc/secure.config` overrides (or
3033supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003034The file should be readable only by the daemon process and can be
3035used to contain private configuration entries that wouldn't normally
3036be exposed to everyone.
3037
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003038Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003039----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003040[auth]
3041 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
Brad Larson3a6f0772012-07-25 11:41:22 -05003042 restTokenPrivateKey = 7e40PzCjlUKOnXATvcBNXH6oyiu+r0dFk2c=
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003043
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003044[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003045 username = webuser
3046 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003047
3048[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003049 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003050
3051[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003052 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003053
3054[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003055 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07003056
3057[remote "bar"]
3058 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003059----
3060
Johan Bjork3e5ee302012-01-27 17:59:54 +01003061File `etc/peer_keys`
3062--------------------
3063
3064The optional file `'$site_path'/etc/peer_keys` controls who can
3065login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
3066command.
3067
3068The format is one Base-64 encoded public key per line.
3069
3070
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003071Database system_config
3072----------------------
3073
3074Several columns in the `system_config` table within the metadata
3075database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003076
3077[NOTE]
3078The contents of the `system_config` table are cached at startup
3079by Gerrit. If you modify any columns in this table, Gerrit needs
3080to be restarted before it will use the new values.
3081
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003082Configurable Parameters
3083~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003084
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003085site_path::
3086+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003087Local filesystem directory holding the site customization assets.
3088Placing this directory under version control and/or backup is a
3089good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003090+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003091Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003092+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003093Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003094+
Dave Borowitz1e49e142013-04-09 12:14:57 -07003095* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003096
Shawn O. Pearce5500e692009-05-28 15:55:01 -07003097GERRIT
3098------
3099Part of link:index.html[Gerrit Code Review]